using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using NUnit.Framework;
using LeadTracker.Models;

namespace LeadTracker.Models.NUnitFluent
{
	
    public partial class EditorModelTests
    {


        
        [Test]
        public void EditorModelTests_Property_UserName_NotifyPropertyChanged ()
        {
            var objectUnderTest = CreateObject();
            var events = new List<PropertyChangedEventArgs>();
            ((INotifyPropertyChanged)objectUnderTest).PropertyChanged += (s, e) => events.Add(e);


			//Setting the value to the current value should always work and not raise any events
			var originalValue = objectUnderTest.UserName;
			objectUnderTest.UserName = originalValue;
			Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

        
            
            events.Clear();
            try
            {
                System.String expectedValue = null;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "x";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = ",";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "123";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "abc";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1,2,3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a,b,c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1;2;3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a;b;c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "http://test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "test@test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.UserName);
                objectUnderTest.UserName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "UserName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
        
        }    
        
        
        [Test]
        public void EditorModelTests_Property_FirstName_NotifyPropertyChanged ()
        {
            var objectUnderTest = CreateObject();
            var events = new List<PropertyChangedEventArgs>();
            ((INotifyPropertyChanged)objectUnderTest).PropertyChanged += (s, e) => events.Add(e);


			//Setting the value to the current value should always work and not raise any events
			var originalValue = objectUnderTest.FirstName;
			objectUnderTest.FirstName = originalValue;
			Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

        
            
            events.Clear();
            try
            {
                System.String expectedValue = null;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "x";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = ",";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "123";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "abc";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1,2,3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a,b,c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1;2;3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a;b;c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "http://test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "test@test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.FirstName);
                objectUnderTest.FirstName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "FirstName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
        
        }    
        
        
        [Test]
        public void EditorModelTests_Property_LastName_NotifyPropertyChanged ()
        {
            var objectUnderTest = CreateObject();
            var events = new List<PropertyChangedEventArgs>();
            ((INotifyPropertyChanged)objectUnderTest).PropertyChanged += (s, e) => events.Add(e);


			//Setting the value to the current value should always work and not raise any events
			var originalValue = objectUnderTest.LastName;
			objectUnderTest.LastName = originalValue;
			Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

        
            
            events.Clear();
            try
            {
                System.String expectedValue = null;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "x";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = ",";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "123";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "abc";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1,2,3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a,b,c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1;2;3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a;b;c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "http://test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "test@test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.LastName);
                objectUnderTest.LastName = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "LastName"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
        
        }    
        
        
        [Test]
        public void EditorModelTests_Property_EmailAddress_NotifyPropertyChanged ()
        {
            var objectUnderTest = CreateObject();
            var events = new List<PropertyChangedEventArgs>();
            ((INotifyPropertyChanged)objectUnderTest).PropertyChanged += (s, e) => events.Add(e);


			//Setting the value to the current value should always work and not raise any events
			var originalValue = objectUnderTest.EmailAddress;
			objectUnderTest.EmailAddress = originalValue;
			Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

        
            
            events.Clear();
            try
            {
                System.String expectedValue = null;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "x";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = ",";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "123";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "abc";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1,2,3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a,b,c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "1;2;3";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "a;b;c";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "http://test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.String expectedValue = "test@test.com";
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.EmailAddress);
                objectUnderTest.EmailAddress = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "EmailAddress"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
        
        }    
        
        
        [Test]
        public void EditorModelTests_Property_IsEnabled_NotifyPropertyChanged ()
        {
            var objectUnderTest = CreateObject();
            var events = new List<PropertyChangedEventArgs>();
            ((INotifyPropertyChanged)objectUnderTest).PropertyChanged += (s, e) => events.Add(e);


			//Setting the value to the current value should always work and not raise any events
			var originalValue = objectUnderTest.IsEnabled;
			objectUnderTest.IsEnabled = originalValue;
			Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

        
            
            events.Clear();
            try
            {
                System.Boolean expectedValue = true;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.IsEnabled);
                objectUnderTest.IsEnabled = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "IsEnabled"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
            
            events.Clear();
            try
            {
                System.Boolean expectedValue = false;
                var valueChanged = !Object.Equals(expectedValue, objectUnderTest.IsEnabled);
                objectUnderTest.IsEnabled = expectedValue;
                
            	if (valueChanged)
					Assert.IsTrue(events.Any(e => e.PropertyName == "IsEnabled"));
				else
					Assert.IsTrue(events.Count() == 0, "No change events should have been raised, the property's value didn't change.");

            }
            catch (ArgumentException)
            {
                //OK
                return;
            }
            
        
        }    
        
    }
}

